<template>
	<view class="container">
		<view class="left">
			<van-sidebar :active-key="activeKey">
				<van-sidebar-item v-for="(item, index) in list" :key="index" sidebar-selected-border-color="#32C59A"
					:title="type == '1' ? item.departmentName : item.hospitalName" @click="select(item.id)" />
			</van-sidebar>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			activeKey: {
				default: 0,
			},
			list: {
				default: [],
			},
			type: {
				default: "1",
			},
		},
		data() {
			return {};
		},
		methods: {
			select(id) {
				this.$emit("select", id);
			},
		},
		mounted() {
			console.log(this.list);
		},
	};
</script>

<style lang="scss" scoped>
	.left {
		background-color: #f1efef;
		height: 100%;
	}
</style>